<template>
  <div class="site-containner">
    <el-row :gutter="20" class="seachnav">
      <el-col :xs="7" :sm="6" :md="4" :lg="6" :xl="6">
        <span><img :src="returnnormalpress" class="returnnormalpress"/></span>
        <span><img :src="realtimeindex" class="equiplist"/></span>
        <span class="description">零配件到期提醒</span>
      </el-col>
      <el-col :xs="7" :sm="6" :md="18" :lg="18" :xl="21" class="con" >
      </el-col>
    </el-row>
    <div class="app-container">
      <el-row>
        <el-col :span="24">
          <!--<div class="outMore">-->
            <!--<div class="dataTitle">-->
              <!--到期提醒总览-->
            <!--</div>-->
          <!--</div>-->
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-dialog
              title="提示"
              :visible.sync="dialogCycle"
              width="540px"
              class="safeDisableDialog"
              style="margin-top: 20vh;">
              <div style="width: 100%; text-align: center; height: 100px; padding-top: 30px;">
                <img :src="problemIcon"/>
              </div>
              <span>确认仅代表已知悉此提示信息内容。</span><br>
              <span>是否只做确认处理?</span>
              <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="enterCycleWork()">是</el-button>
                <el-button class="clear" @click="dialogCycle = false">否</el-button>
              </span>
            </el-dialog>
            <el-dialog
              title="提示"
              :visible.sync="dialogCycleDelete"
              width="540px"
              class="safeDisableDialog"
              style="margin-top: 20vh;">
              <div style="width: 100%; text-align: center; height: 100px; padding-top: 30px;">
                <img :src="problemIcon"/>
              </div>
              <span>是否确认并清零?</span>
              <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="enterCycleDeleteWork()">是</el-button>
                <el-button class="clear" @click="dialogCycleDelete = false">否</el-button>
              </span>
            </el-dialog>
            <el-dialog
              title="提示"
              :visible.sync="dialogExpiration"
              width="540px"
              class="safeDisableDialog"
              style="margin-top: 20vh;">
              <div style="width: 100%; text-align: center; height: 100px; padding-top: 30px;">
                <img :src="problemIcon"/>
              </div>
              <span>确认仅代表已知悉此提示信息内容。</span><br>
              <span>是否只做确认处理?</span>
              <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="enterExpirationWork()">是</el-button>
                <el-button class="clear" @click="dialogExpiration = false">否</el-button>
              </span>
            </el-dialog>
            <el-dialog
              title="更换配件"
              :visible.sync="dialogParts"
              width="540px"
              class="safeDisableDialog dialogPartsHeight"
              style="margin-top: 14vh;">
              <el-form :model="changePartsData" class="demo-form-inline" label-width="90px">
                <el-form-item class="handItem" label="配件名称:">
                  <el-input class="dialogInput readonlyOne" v-model="changePartsData.data.equip_name" readonly></el-input>
                </el-form-item>
                <span style="position: absolute; margin: 12px 0px 0px -258px; color: #E53D41;">*</span>
                <el-form-item class="handItem" label="新配件品牌:">
                  <el-input class="dialogInput" v-model="changePartsData.data.new_fittings_brand"></el-input>
                </el-form-item>
                <span style="position: absolute; margin: 12px 0px 0px -258px; color: #E53D41;">*</span>
                <el-form-item class="handItem" label="新配件型号:">
                  <el-input class="dialogInput" v-model="changePartsData.data.new_fittings_model"></el-input>
                </el-form-item>
                <el-form-item class="handItem" label="序列号:">
                  <el-input class="dialogInput" v-model="changePartsData.data.new_fittings_num"></el-input>
                </el-form-item>
                <span style="position: absolute; margin: 12px 0px 0px -244px; color: #E53D41;">*</span>
                <el-form-item class="handItem" label="更换原因:">
                  <el-input class="dialogInput" v-model="changePartsData.data.update_reason"></el-input>
                </el-form-item>
                <span style="position: absolute; margin: 12px 0px 0px -230px; color: #E53D41;">*</span>
                <el-form-item class="handItem" label="处理人:">
                  <el-select class="dialogInput" v-model="changePartsData.data.handle_user_id" clearable filterable placeholder="请选择">
                    <el-option
                      v-for="item in peoples"
                      :key="item.account"
                      :label="item.name"
                      :value="item.account">
                    </el-option>
                  </el-select>
                </el-form-item>
                <span style="position: absolute; margin: 12px 0px 0px -244px; color: #E53D41;">*</span>
                <el-form-item class="handItem" label="完成时间:">
                  <el-date-picker
                    v-model="changePartsData.data.finish_time"
                    type="datetime"
                    class="dialogInput"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择日期时间">
                  </el-date-picker>
                </el-form-item>
              </el-form>
              <span slot="footer" class="dialog-footer">
                <div class="annotation" style="float: left; margin-top: 5px;">注：<span style="color: #E53D41">*</span>为必填项</div>
                <el-button type="primary" @click="changePartsWork()">是</el-button>
                <el-button class="clear" @click="dialogParts = false">否</el-button>
              </span>
            </el-dialog>
            <el-tab-pane label="周期提醒" name="first">
              <div class="tabStyle">
                <div class="organizationOutMore">
                  <el-form :inline="true" :model="getCycleData" class="demo-form-inline">
                    <el-form-item class="handItem" label="出厂编号:">
                      <el-input class="handInput" v-model="getCycleData.data.condition.equip_cid"></el-input>
                    </el-form-item>
                    <el-form-item class="handItem" label="设备名称:">
                      <el-input class="handInput" v-model="getCycleData.data.condition.equip_name"></el-input>
                    </el-form-item>
                    <el-form-item class="handItem" label="机构:">
                      <el-select class="handInput" v-model="getCycleData.data.condition.fittings_type" clearable filterable placeholder="请选择">
                        <el-option
                          v-for="item in options"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                        </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item class="handItem" label="状态:">
                      <el-select class="handInputTwo" v-model="getCycleData.data.condition.status" clearable filterable placeholder="请选择">
                        <el-option
                          v-for="item in theStatus"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                        </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item class="handItem">
                      <el-button type="primary" @click="getCycleList">查询</el-button>
                    </el-form-item>
                    <el-form-item class="handItem">
                      <el-button class="clear" type="primary" @click="returnCycleList">重置</el-button>
                    </el-form-item>
                  </el-form>
                </div>
                <div class="organizationTable">
                  <div class="pagination-container footerPage">
                    <el-pagination
                      @current-change="cycleCurrentChange"
                      @size-change="cycleSizeChange"
                      :page-sizes="[5, 10, 20, 50]"
                      background layout="total, sizes, prev, pager, next"
                      :total="cycletotal">
                    </el-pagination>
                  </div>
                  <el-table :key='tableKey' :data="cycleList" stripe fit highlight-current-row height="680" ref="thetree"
                            style="width: 100%; max-height:755px;" :header-cell-style="{background:'#F7F8F9'}">
                    <el-table-column
                      prop="index"
                      align="center"
                      label="序号"
                      width="60px"
                    >
                    </el-table-column>
                    <el-table-column
                      prop="equip_cid"
                      label="出厂编号"
                      width="200">
                    </el-table-column>
                    <el-table-column
                      prop="equip_name"
                      label="设备名称"
                      min-width="250">
                    </el-table-column>
                    <el-table-column
                      prop="fittings_type_label"
                      label="机构"
                      width="200">
                    </el-table-column>
                    <el-table-column
                      prop="fittings_name"
                      label="配件名称"
                      min-width="250">
                    </el-table-column>
                    <el-table-column
                      prop="cumulative_num"
                      label="累计次数/时间"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="remind_time"
                      label="发生时间"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="status"
                      label="状态"
                      width="130">
                      <template slot-scope="scope">
                        <el-tag v-if="scope.row.status === '已处理' || scope.row.status === '未处理'"
                          :type="scope.row.status === '已处理' ? 'primary' : 'success'"
                          disable-transitions>{{scope.row.status}}</el-tag>
                        <el-tag v-if="scope.row.status === '已确认'" style="color: #45b358"
                                disable-transitions>{{scope.row.status}}</el-tag>
                        <el-tag v-if="scope.row.status === '已清零'" style="color: #999999"
                                disable-transitions>{{scope.row.status}}</el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="操作"
                      width="130">
                      <template slot-scope="scope">
                        <el-button class="tableIcon" type="text" title="查看" @click="lookCycle(scope.row)" size="small">
                          <img :src="detail" alt="查看"/>
                        </el-button>
                        <el-dropdown v-if="scope.row.status === '未处理' || scope.row.status === '已确认' || scope.row.status === '已清零'" trigger="click" class="overviewDropdown">
                          <span class="el-dropdown-link">
                            更多操作<i class="el-icon-caret-bottom"></i>
                          </span>
                          <el-dropdown-menu slot="dropdown">
                            <el-button v-if="scope.row.status === '未处理'" class="associatedbuttom" type="button" @click.native.prevent="enterCycleDialog(scope.row)">确认</el-button>
                            <el-button v-if="scope.row.status === '未处理' || scope.row.status === '已确认'" class="associatedbuttom" type="button" @click.native.prevent="enterCycleDelete(scope.row)">确认并清零</el-button><span v-if="scope.row.status === '未处理' || scope.row.status === '已确认'">——————</span>
                            <el-button class="associatedbuttom" type="button" @click.native.prevent="cycleChangeParts(scope.row)">更换配件</el-button>
                          </el-dropdown-menu>
                        </el-dropdown>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
              </div>
            </el-tab-pane>
            <el-tab-pane label="到期提醒" name="second">
              <div class="tabStyle">
                <div class="organizationOutMore">
                  <el-form :inline="true" :model="getExpirationData" class="demo-form-inline">
                    <el-form-item class="handItem" label="出厂编号:">
                      <el-input class="handInput" v-model="getExpirationData.data.condition.equip_cid"></el-input>
                    </el-form-item>
                    <el-form-item class="handItem" label="设备名称:">
                      <el-input class="handInput" v-model="getExpirationData.data.condition.equip_name"></el-input>
                    </el-form-item>
                    <el-form-item class="handItem" label="机构:">
                      <el-select class="handInput" v-model="getExpirationData.data.condition.fittings_type" clearable filterable placeholder="请选择">
                        <el-option
                          v-for="item in options"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                        </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item class="handItem" label="状态:">
                      <el-select class="handInputTwo" v-model="getExpirationData.data.condition.status" clearable filterable placeholder="请选择">
                        <el-option
                          v-for="item in twoStatus"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                        </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item class="handItem">
                      <el-button type="primary" @click="getExpirationList">查询</el-button>
                    </el-form-item>
                    <el-form-item class="handItem">
                      <el-button class="clear" type="primary" @click="returnExpirationList">重置</el-button>
                    </el-form-item>
                  </el-form>
                </div>
                <div class="organizationTable">
                  <div class="pagination-container footerPage">
                    <el-pagination
                      @current-change="expirationCurrentChange"
                      @size-change="expirationSizeChange"
                      :page-sizes="[5, 10, 20, 50]"
                      background layout="total, sizes, prev, pager, next"
                      :total="expirationtotal">
                    </el-pagination>
                  </div>
                  <el-table :key='tableKey' :data="expirationList" stripe fit highlight-current-row height="680" ref="thetree"
                            style="width: 100%; max-height:755px;" :header-cell-style="{background:'#F7F8F9'}">
                    <el-table-column
                      prop="index"
                      align="center"
                      label="序号"
                      width="60px"
                    >
                    </el-table-column>
                    <el-table-column
                      prop="equip_cid"
                      label="出厂编号"
                      width="200">
                    </el-table-column>
                    <el-table-column
                      prop="equip_name"
                      label="设备名称"
                      min-width="250">
                    </el-table-column>
                    <el-table-column
                      prop="fittings_type_label"
                      label="机构"
                      width="200">
                    </el-table-column>
                    <el-table-column
                      prop="fittings_name"
                      label="配件名称"
                      min-width="250">
                    </el-table-column>
                    <el-table-column
                      prop="cumulative_num_year"
                      label="累计次数/年限"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="remind_time"
                      label="发生时间"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="status"
                      label="状态"
                      width="130">
                      <template slot-scope="scope">
                        <el-tag v-if="scope.row.status === '已处理' || scope.row.status === '未处理'"
                                :type="scope.row.status === '已处理' ? 'primary' : 'success'"
                                disable-transitions>{{scope.row.status}}</el-tag>
                        <el-tag v-if="scope.row.status === '已确认'" style="color: #45b358"
                                disable-transitions>{{scope.row.status}}</el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="操作"
                      width="130">
                      <template slot-scope="scope">
                        <el-button class="tableIcon" type="text" title="查看" @click="lookExpiration(scope.row)" size="small">
                          <img :src="detail" alt="查看"/>
                        </el-button>
                        <el-dropdown v-if="scope.row.status === '未处理' || scope.row.status === '已确认'" trigger="click" class="overviewDropdown">
                          <span class="el-dropdown-link">
                            更多操作<i class="el-icon-caret-bottom"></i>
                          </span>
                          <el-dropdown-menu slot="dropdown">
                            <el-button v-if="scope.row.status === '未处理'" class="associatedbuttom" type="button" @click.native.prevent="enterExpirationDialog(scope.row)">确认</el-button><span v-if="scope.row.status === '未处理'">——————</span>
                            <el-button class="associatedbuttom" type="button" @click.native.prevent="expireChangeParts(scope.row)">更换配件</el-button>
                          </el-dropdown-menu>
                        </el-dropdown>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
              </div>
            </el-tab-pane>
          </el-tabs>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
  import detail from '@/assets/reports/detail_normal.png'
  import axios from 'axios'
  import problemIcon from '@/assets/mSiteAdmin/problem-icon.png'
  import realtimeindex from '@/assets/home/management.png'
  import returnnormalpress from '@/assets/home/returninvalid.png'
  export default {
    name: 'MsiteAdmin',
    components: {
    },
    data() {
      return {
        realtimeindex,
        returnnormalpress,
        detail,
        problemIcon,
        options: [],
        dialogCycle: false,
        dialogCycleDelete: false,
        dialogExpiration: false,
        dialogParts: false,
        theStatus: [{
          label: '未处理',
          value: '0'
        }, {
          label: '已处理',
          value: '1'
        }, {
          label: '已确认',
          value: '2'
        }, {
          label: '已清零',
          value: '3'
        }],
        twoStatus: [{
          label: '未处理',
          value: '0'
        }, {
          label: '已处理',
          value: '1'
        }, {
          label: '已确认',
          value: '2'
        }],
        peoples: [],
        activeName: 'first',
        cycleList: [],
        expirationList: [],
        tableKey: 0,
        cycletotal: 0,
        expirationtotal: 0,
        getCycleData: {
          access_token: localStorage.getItem('access_token'),
          type: 'cycle_remind_get_condition',
          data: {
            condition: {
              ids: [],
              equip_cid: '',
              equip_name: '',
              fittings_type: '',
              begin_time: '',
              end_time: '',
              fittings_id: '',
              fittings_name: '',
              status: ''
            },
            page: {
              page_size: '10',
              page_number: '1'
            }
          }
        },
        getExpirationData: {
          access_token: localStorage.getItem('access_token'),
          type: 'expire_remind_get_condition',
          data: {
            condition: {
              ids: [],
              equip_cid: '',
              equip_name: '',
              fittings_type: '',
              begin_time: '',
              end_time: '',
              fittings_id: '',
              fittings_name: '',
              status: ''
            },
            page: {
              page_size: '10',
              page_number: '1'
            }
          }
        },
        getAllSelectData: {
          access_token: localStorage.getItem('access_token'),
          type: 'fittings_get_basicdata'
        },
        enterCycle: {
          access_token: localStorage.getItem('access_token'),
          type: 'cycle_remind_confirm',
          ids: []
        },
        enterCycleDeleteData: {
          access_token: localStorage.getItem('access_token'),
          type: 'cycle_remind_confirm_clear',
          ids: []
        },
        enterExpiration: {
          access_token: localStorage.getItem('access_token'),
          type: 'expire_remind_confirm',
          ids: []
        },
        changePartsDataCopy: {
          expire_remind_id: 0,
          cycle_remind_id: 0,
          equip_cid: '',
          equip_name: '',
          fittings_id: '',
          fittings_name: '',
          fittings_type: '',
          update_reason: '',
          new_fittings_brand: '',
          new_fittings_model: '',
          new_fittings_num: '',
          handle_user_id: '',
          handle_user_name: '',
          finish_time: ''
        },
        changePartsData: {
          access_token: localStorage.getItem('access_token'),
          type: 'update_log_replace',
          data: {
            expire_remind_id: 0,
            cycle_remind_id: 0,
            equip_cid: '',
            equip_name: '',
            fittings_id: '',
            fittings_name: '',
            fittings_type: '',
            update_reason: '',
            new_fittings_brand: '',
            new_fittings_model: '',
            new_fittings_num: '',
            handle_user_id: '',
            handle_user_name: '',
            finish_time: ''
          }
        },
        // 获取人员信息
        getAccountsBody: {
          access_token: localStorage.getItem('access_token'),
          type: 'get_accounts',
          data: ''
        }
      }
    },
    created() {
      this.tabsChoice()
      this.getAllSelect()
      this.getAccounts()
    },
    methods: {
      handleClick(tab) {
        if (tab.index === '0') {
          this.returnCycleList()
        } else {
          this.returnExpirationList()
        }
      },
      getAccounts() {
        let httpStr = process.env.SERVER_URL_4A
        axios.post(httpStr + '/account', this.getAccountsBody, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          this.peoples = res.data.datas
        })
          .catch((error) => {
            console.log(error)
          })
      },
      tabsChoice() {
        if (this.$route.query.tabsNub) {
          this.activeName = this.$route.query.tabsNub
        }
        if (this.activeName === 'second') {
          this.getExpirationList()
        } else {
          this.getCycleList()
        }
      },
      getAllSelect() {
        axios.post('/fittings', this.getAllSelectData, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          this.options = res.data.fittings_type
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      returnCycleList() {
        this.getCycleData.data.condition.equip_cid = ''
        this.getCycleData.data.condition.equip_name = ''
        this.getCycleData.data.condition.fittings_type = ''
        this.getCycleData.data.condition.status = ''
        this.getCycleList()
      },
      getCycleList() {
        axios.post('/fittings', this.getCycleData, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          this.cycleList = res.data.data.items
          for (let a = 0; a < res.data.data.items.length; a++) {
            this.cycleList[a].index = (a + 1) + (res.data.data.page.page_number - 1) * res.data.data.page.page_size
          }
          for (let i = 0; i < this.cycleList.length; i++) {
            if (this.cycleList[i].status === 0) {
              this.cycleList[i].status = '未处理'
            } else if (this.cycleList[i].status === 1) {
              this.cycleList[i].status = '已处理'
            } else if (this.cycleList[i].status === 2) {
              this.cycleList[i].status = '已确认'
            } else if (this.cycleList[i].status === 3) {
              this.cycleList[i].status = '已清零'
            }
          }
          this.cycletotal = parseInt(res.data.data.page.total)
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      returnExpirationList() {
        this.getExpirationData.data.condition.equip_cid = ''
        this.getExpirationData.data.condition.equip_name = ''
        this.getExpirationData.data.condition.fittings_type = ''
        this.getExpirationData.data.condition.status = ''
        this.getExpirationList()
      },
      getExpirationList() {
        axios.post('/fittings', this.getExpirationData, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          this.expirationList = res.data.data.items
          for (let a = 0; a < res.data.data.items.length; a++) {
            this.expirationList[a].index = (a + 1) + (res.data.data.page.page_number - 1) * res.data.data.page.page_size
          }
          for (let i = 0; i < this.expirationList.length; i++) {
            if (this.expirationList[i].status === 0) {
              this.expirationList[i].status = '未处理'
            } else if (this.expirationList[i].status === 1) {
              this.expirationList[i].status = '已处理'
            } else if (this.expirationList[i].status === 2) {
              this.expirationList[i].status = '已确认'
            }
          }
          this.expirationtotal = parseInt(res.data.data.page.total)
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      // 当前页
      cycleCurrentChange(val) {
        this.getCycleData.data.page.page_number = (val) + ''
        this.getCycleList()
      },
      // 每页显示多少条
      cycleSizeChange(pageSize) {
        this.getCycleData.data.page.page_size = (pageSize) + ''
        this.getCycleList()
      },
      // 当前页
      expirationCurrentChange(val) {
        this.getExpirationData.data.page.page_number = (val) + ''
        this.getExpirationList()
      },
      // 每页显示多少条
      expirationSizeChange(pageSize) {
        this.getExpirationData.data.page.page_size = (pageSize) + ''
        this.getExpirationList()
      },
      lookCycle(row) {
        var looknumber = row.id
        this.$router.push({
          path: '/monitor/system/components/cycleLook',
          query: {
            id: looknumber
          }
        })
      },
      lookExpiration(row) {
        var looknumber = row.id
        this.$router.push({
          path: '/monitor/system/components/expirationLook',
          query: {
            id: looknumber
          }
        })
      },
      enterCycleDialog(rows) {
        this.enterCycle.ids = []
        this.enterCycle.ids.push(parseInt(rows.id))
        this.dialogCycle = true
      },
      enterCycleWork() {
        axios.post('/fittings', this.enterCycle, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          if (res.data.errcode === '00000') {
            this.dialogCycle = false
            this.getCycleList()
          }
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      enterExpirationDialog(rows) {
        this.enterExpiration.ids = []
        this.enterExpiration.ids.push(parseInt(rows.id))
        this.dialogExpiration = true
      },
      enterExpirationWork() {
        axios.post('/fittings', this.enterExpiration, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          if (res.data.errcode === '00000') {
            this.dialogExpiration = false
            this.getExpirationList()
          }
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      enterCycleDelete(rows) {
        this.enterCycleDeleteData.ids = []
        this.enterCycleDeleteData.ids.push(rows.id)
        this.dialogCycleDelete = true
      },
      enterCycleDeleteWork() {
        axios.post('/fittings', this.enterCycleDeleteData, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          if (res.data.errcode === '00000') {
            this.dialogCycleDelete = false
            this.getCycleList()
          }
        })
          .catch(function(error) {
            console.log(error)
          })
      },
      expireChangeParts(rows) {
        this.changePartsData.data.new_fittings_brand = ''
        this.changePartsData.data.new_fittings_model = ''
        this.changePartsData.data.new_fittings_num = ''
        this.changePartsData.data.update_reason = ''
        this.changePartsData.data.handle_user_id = ''
        this.changePartsData.data.finish_time = ''
        this.changePartsData.data.expire_remind_id = parseInt(rows.id)
        this.changePartsData.data.cycle_remind_id = 0
        this.changePartsData.data.equip_cid = rows.equip_cid
        this.changePartsData.data.equip_name = rows.equip_name
        this.changePartsData.data.fittings_id = rows.fittings_id
        this.changePartsData.data.fittings_name = rows.fittings_name
        this.changePartsData.data.fittings_type = rows.fittings_type
        this.dialogParts = true
      },
      cycleChangeParts(rows) {
        console.log(rows)
        this.changePartsData.data.new_fittings_brand = ''
        this.changePartsData.data.new_fittings_model = ''
        this.changePartsData.data.new_fittings_num = ''
        this.changePartsData.data.update_reason = ''
        this.changePartsData.data.handle_user_id = ''
        this.changePartsData.data.finish_time = ''
        this.changePartsData.data.expire_remind_id = 0
        this.changePartsData.data.cycle_remind_id = parseInt(rows.id)
        this.changePartsData.data.equip_cid = rows.equip_cid
        this.changePartsData.data.equip_name = rows.equip_name
        this.changePartsData.data.fittings_id = rows.fittings_id
        this.changePartsData.data.fittings_name = rows.fittings_name
        this.changePartsData.data.fittings_type = rows.fittings_type
        this.dialogParts = true
      },
      changePartsWork() {
        for (var i = 0; i < this.peoples.length; i++) {
          if (this.peoples[i].account === this.changePartsData.data.handle_user_id) {
            this.changePartsData.data.handle_user_name = this.peoples[i].name
          }
        }
        axios.post('/fittings', this.changePartsData, {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }).then((res) => {
          if (res.data.errcode === '00000') {
            this.changePartsData.data = this.changePartsDataCopy
            this.tabsChoice()
            this.dialogParts = false
          }
        })
          .catch((error) => {
            this.$message.error(error.data.errmsg)
          })
      }
    }
  }
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .site-containner{
    font-size: 16px;
    color: #25B6C7;
    .seachnav{
      width: 60%;
      height: 50px;
      position: fixed;
      z-index: 2;
      top:0;
      bottom: 0;
      line-height: 55px;
      padding-left: 20px;
      .description{
        font-size: 18px;
        color: #333;
        line-height: 10px;
        padding-left: 10px;
      }
      .returnnormalpress{
        vertical-align: middle;
      }
      .equiplist{
        vertical-align: middle;
        margin-left: 10px;
      }
      .searchinvalid{
        vertical-align: middle;
      }
      .con{
        width: 85%;
        height: 50px;
        float: right;
        margin-right: 20px;
        line-height: 3px;
        padding-left: 0 !important;
        .seachContent{
          font-size:18px;
          font-family:MicrosoftYaHei;
          font-weight:400;
          padding-top: 0px;
          color:rgba(51,51,51,1);
        }
        .seachtitle{
          font-size:12px;
          font-family:MicrosoftYaHei;
          font-weight:400;
          color:rgba(102,102,102,1);
        }
      }
    }
  }
  .outMore{
    height: 40px;
    padding-top: 2px;
    border-bottom: 1px solid #E1E1E1;
  }
  .dataTitle {
    height: 16px;
    font-size: 16px;
    color: #323842;
  }
  .organizationOutMore{
    width: 100%;
    height: 50px;
    background-color: #ffffff;
    padding-top: 5px;
    padding-left: 20px;
    border-bottom: 1px solid #e0e0e0;
  }
  /deep/ .handItem {
    margin-bottom: 5px!important;
  }
  /deep/ .dialogInput {
    width: 400px;
  }
  /deep/ .handInput {
    width: 160px;
  }
  /deep/ .handInputTwo {
    width: 120px;
  }
  /deep/ .el-input__inner {
    height: 30px;
    line-height: 30px;
  }
  /deep/ .tableIcon {
    padding: 0px;
    font-size: 20px;
    font-weight: 500;
  }
  /deep/ .el-button--primary {
    height: 30px;
    font-size: 14px;
    padding: 6px 16px;
    background: #0072F3;
    border-color: #0072F3;
  }
  /deep/ .clear{
    padding: 6px 16px;
    background-color: #526D89;
    border-color: #526D89 ;
    color: #fff;
  }
  /deep/ .footerPage{
    float: right;
    margin: 5px 0px;
  }
  /*改变tab颜色*/
  /deep/ .el-tabs__nav-scroll {
    background: #ffffff;
  }
  /deep/ .el-tabs__nav {
    height: 50px;
    line-height: 50px;
    margin-left: 20px;
  }
  /deep/ .el-tabs__item.is-active {
    color: #0072F3;
  }
  /deep/ .el-tabs__active-bar {
    background: #0072F3;
    height: 4px;
  }
  /deep/ .el-tag {
    background-color: transparent;
    border: none;
  }
  /deep/ .el-tag--success {
    background-color: transparent;
    color: #F99F62;
  }
  /deep/ .el-tag--primary {
    background-color: transparent;
    color: #000;
  }
  /deep/ .overviewDropdown {
    width:74px;
    margin-left: 5px;
    top: -4px;
    cursor: pointer;
  }
  /deep/ .el-dropdown-link {
     font-size: 10px;
     padding:2px;
     color: #0072F3;
   }
  /deep/ .associatedbuttom {
    text-align: left;
    color: #323842;
    border: none;
    margin-left: 5px;
    padding: 10px;
    height: 24px;
    width: 88px;
    font-size: 12px;
  }
  .el-popper[x-placement^="bottom"] {
    margin-top: 12px;
    width: 98px;
    color: #e0e0e0;
  }
  .el-dropdown-menu {
    margin-top: 12px;
    width: 98px;
    color: #e0e0e0;
  }
  .tabStyle {
    background-color: white;
  }
  /deep/ .safeDisableDialog > .el-dialog > .el-dialog__body {
    text-align: center;
    font-size: 18px;
    height: 180px;
    border-bottom: 1px solid #e8eaf1;
  }
  /deep/ .dialogPartsHeight > .el-dialog > .el-dialog__body {
    height: 350px;
  }
  /deep/ .safeDisableDialog > .el-dialog > .el-dialog__footer {
    height: 60px;
  }
  /deep/ .safeDisableDialog > .el-dialog > .el-dialog__footer > .dialog-footer > button {
    height: 30px;
    font-size: 14px;
    padding: 6px 32px;
  }
  /deep/ .el-dialog {
    border-radius: 5px;
  }
  /deep/ .el-dialog__header {
    background: #E3E6EE;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 20px 9px 20px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    line-height: 20px;
  }
  /deep/ .el-dialog__headerbtn {
    top: 15px;
  }
  /deep/ .el-dialog__body {
    padding: 20px;
  }
  /deep/ .annotation {
    color: #303133;
    float: left;
    margin-top: 5px;
  }
  /deep/ .readonlyOne > .el-input__inner {
    border: none;
  }
</style>
